  <script>
      
      function startDrawing(poly, name, onUpdate, color) {
  map.addOverlay(poly);
  poly.enableDrawing(options);
  poly.enableEditing({onEvent: "mouseover"});
  poly.disableEditing({onEvent: "mouseout"});
  GEvent.addListener(poly, "endline", function() {
    select("hand_b");
    var cells = addFeatureEntry(name, color);
    GEvent.bind(poly, "lineupdated", cells.desc, onUpdate);
    GEvent.addListener(poly, "click", function(latlng, index) {
      if (typeof index == "number") {
        poly.deleteVertex(index);
      } else {
        var newColor = getColor(false);
        cells.color.style.backgroundColor = newColor
        poly.setStrokeStyle({color: newColor, weight: 4});
      }
    });
  });
}
function initialize() {



    var argv = initialize.arguments;
    var argc = argv.length;
        
    var fullurl = new String();

    fullurl = parent.document.URL.toString();
    var Latitud = new String();
    Latitud = fullurl.substr(fullurl.indexOf("Lati=") + 5, fullurl.indexOf("Long=") - fullurl.indexOf("Lati=") - 6);
    var Longitud = new String();
    Longitud = fullurl.substr(fullurl.indexOf("Long=") + 5, fullurl.indexOf('Cc=') - fullurl.indexOf("Long=") - 6);
    var CantidadCaballos = new String();
    CantidadCaballos = fullurl.substr(fullurl.indexOf("Cc=") + 3, fullurl.indexOf('*') - fullurl.indexOf("Cc=") - 3);

    var NombreCaballo = new String();
    var LatitudCaballo = new String();
    var LongitudCaballo = new String();
    var PartialLen = 4;
    var NombreCaballoLen = 0;
    var LatitudCaballoLen = 0;
    var LongitudCaballoLen = 0;

    if (GBrowserIsCompatible()) {

        var map = new GMap2(document.getElementById("map_canvas"));
        //map.setMapType(G_HYBRID_MAP); //APARECE EN HIBRIDO
        map.setMapType(G_NORMAL_MAP); //APARECE EN MAPA
        //map.setMapType(G_SATELLITE_MAP); //APARECE EN MAPA
        
        if (argc == 0) 
        {
            map.setCenter(new GLatLng(-34.122,-58.152, true), 7);
          //      map.setCenter(new GLatLng(Latitud, Longitud, true), 15);
         }
         else if (argc == 2) {
                map.setCenter(new GLatLng(argv[0], argv[1], true), 15);
            
        }
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GOverviewMapControl()); ;
        
    /////////////////////Dibujo de Plolilena recta sin tener en cuenta la geografia
        /*
        var polyline = new GPolyline([
          new GLatLng(-34.122, -58.152),
          new GLatLng(-34.022, -58.052)
        ], "#ff0000", 6);
        map.addOverlay(polyline);
        */
   //////////////////Dibujo de Polilena recta en cuenta la geografia
        /*
        var polyOptions = {geodesic:true};
        var polyline = new GPolyline([
          new GLatLng(-34.222, -58.252),
          new GLatLng(-34.022, -58.052)
          ], "#ff0000", 7, 1, polyOptions);
          map.addOverlay(polyline);
        */
     //////////////////Dibujo POLILINEA 3     
          /*  var polyline = new GPolyline([
            new GLatLng(-34.232, -58.252),
            new GLatLng(-34.222, -58.242),
            new GLatLng(-34.212, -58.232)
            ], "#FF0000", 10);
            map.addOverlay(polyline);
        */


/***********Dibujo de Polilinea con medidas fijadas*************//*                  
        GEvent.addListener(map, 'mouseover', function(overlay, latlng) {
          //var lat = latlng.lat();
          //var lon = latlng.lng();
          var lat = -34.232;
          var lon = -58.252;
          var latOffset = 0.1;
          var lonOffset = 0.1;
          
          var polygon = new GPolygon([
            new GLatLng(lat, lon - lonOffset),
            new GLatLng(lat + latOffset, lon),
            new GLatLng(lat, lon + lonOffset),
            new GLatLng(lat - latOffset, lon),
            new GLatLng(lat, lon - lonOffset)
          ], "#f33f00", 3, 1, "#ff0000", 0.2);
          map.addOverlay(polygon);
        });
/***********Find*************/ 

    /***********Dibujo de Polilinea manual*************/   
      /*  var polyline = new GPolyline([],"#ff0000",3,0.5,0.1,2);
        map.addOverlay(polyline);
        polyline.enableDrawing();
        */
     /***********Dibujar poligono manualmente con contorno y fondo*************/   
        var polygon = new GPolygon([],"#ff0000",3,0.5,"#ff0000",0.2);
        map.addOverlay(polygon);
        polygon.enableDrawing();
        var Area=polygon.getArea();
        
       // alert(Area);
       // openInfoWindowHtml(Area);
       
     //  openInfoWindowHtml(latlng:GLatLng, "donde esta la meida");       
        
        // CREACION DEL ICONO PERSONAL
            var blueIcon = new GIcon(G_DEFAULT_ICON);
            blueIcon.image = "/gmaps/caballo.png";
            markerOptions = { icon:blueIcon };
            

/***********Click y aparece un icono Personal*************//*
        GEvent.addListener(map, "click", function(marker, point) {
          if (marker) {
            map.removeOverlay(marker);
          } else {
            map.addOverlay(new GMarker(point,blueIcon));
          }
        })
/*************fin*************************************/


/***********Seteo Icono Personal*************//*
    baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon.iconSize = new GSize(20, 34);
    baseIcon.shadowSize = new GSize(37, 34);
    baseIcon.iconAnchor = new GPoint(9, 34);
    baseIcon.infoWindowAnchor = new GPoint(9, 2);
*/
/***********Create Icon*************/
        var bounds = map.getBounds();
        var southWest = bounds.getSouthWest();
        var northEast = bounds.getNorthEast();
        var lngSpan = northEast.lng() - southWest.lng();
        var latSpan = northEast.lat() - southWest.lat();

        var point = new GLatLng(-34.122,-58.152);
        
        var Marker=new GMarker(point,markerOptions);
        
       
/***********Click y aparece un icono Personal*************/
     GEvent.addListener(Marker, "click", function() {
        Marker.openInfoWindowHtml("<p>Nombre:</p>");
      });
/***********Fin*************/


/***********Agrego el marker al mapa*************/      
      map.addOverlay(Marker);
/***********Fin*************/
}
    else {
        alert('Su navegador no acepta mapas interactivos');
    }
}

</script>

    <script type="text/javascript">

    //<![CDATA[


function Adicionals{

 /*********Mensaje en el centro*********/
 
 map.openInfoWindow(map.getCenter(),
      document.createTextNode("Hacer click sobre el mapa")); 

      /********fin******************************/



/****************** FIN Inserta Icono-Dibujo*********************/

      }

    </script>
